/*
 * Created on Oct 5, 2006
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package com.knr.client;

import com.google.gwt.user.client.ResponseTextHandler;
import com.google.gwt.user.client.Window;

public class KRResponseHandler implements ResponseTextHandler {
	
	Object[] resultArray = null;
	String searchKey = null;
	String result = null;
	 
	public KRResponseHandler(String searchKey)
	{
		this.searchKey = searchKey;
	}
	public void onCompletion(String resultHTMLAsString)
	{
		Window.alert(resultHTMLAsString);
		resultArray = (new KRTextParser()).extractURLsFromGSearch(resultHTMLAsString, searchKey);
		//System.out.println("result " + resultArray[0]);
		//System.out.println(resultHTMLAsString);
		result = resultHTMLAsString;

		KRJSUtils.replaceString(searchKey, "Kumar");
	}
	
	public String getResult()
	{
		return result;
		//return resultArray[0].toString();
	}

}
